package com.ruoyi.ybUpload.service.tableCode.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ybUpload.mapper.TraceCodeDetailMapper;
import com.ruoyi.ybUpload.domain.tableCode.TraceCodeDetail;
import com.ruoyi.ybUpload.service.tableCode.ITraceCodeDetailService;

/**
 * 追溯码明细表Service业务层处理
 *
 * @author wkw
 * @date 2024-08-07
 */
@Service
public class TraceCodeDetailServiceImpl implements ITraceCodeDetailService
{
    @Autowired
    private TraceCodeDetailMapper traceCodeDetailMapper;

    /**
     * 查询追溯码明细表
     *
     * @param id 追溯码明细表主键
     * @return 追溯码明细表
     */
    @Override
    public TraceCodeDetail selectTraceCodeDetailById(Long id)
    {
        return traceCodeDetailMapper.selectTraceCodeDetailById(id);
    }

    /**
     * 查询追溯码明细表列表
     *
     * @param traceCodeDetail 追溯码明细表
     * @return 追溯码明细表
     */
    @Override
    public List<TraceCodeDetail> selectTraceCodeDetailList(TraceCodeDetail traceCodeDetail)
    {
        return traceCodeDetailMapper.selectTraceCodeDetailList(traceCodeDetail);
    }

    /**
     * 新增追溯码明细表
     *
     * @param traceCodeDetail 追溯码明细表
     * @return 结果
     */
    @Override
    public int insertTraceCodeDetail(TraceCodeDetail traceCodeDetail)
    {
        traceCodeDetail.setCreateTime(DateUtils.getNowDate());
        return traceCodeDetailMapper.insertTraceCodeDetail(traceCodeDetail);
    }

    /**
     * 修改追溯码明细表
     *
     * @param traceCodeDetail 追溯码明细表
     * @return 结果
     */
    @Override
    public int updateTraceCodeDetail(TraceCodeDetail traceCodeDetail)
    {
        traceCodeDetail.setUpdateTime(DateUtils.getNowDate());
        return traceCodeDetailMapper.updateTraceCodeDetail(traceCodeDetail);
    }

    /**
     * 批量删除追溯码明细表
     *
     * @param ids 需要删除的追溯码明细表主键
     * @return 结果
     */
    @Override
    public int deleteTraceCodeDetailByIds(Long[] ids)
    {
        return traceCodeDetailMapper.deleteTraceCodeDetailByIds(ids);
    }

    /**
     * 删除追溯码明细表信息
     *
     * @param id 追溯码明细表主键
     * @return 结果
     */
    @Override
    public int deleteTraceCodeDetailById(Long id)
    {
        return traceCodeDetailMapper.deleteTraceCodeDetailById(id);
    }
}